package com.hicorp.segment.mapper;

import com.hicorp.segment.mapper.basic.BasicMapper;
import com.hicorp.segment.pojo.po.MaterialConcrete;
import com.hicorp.segment.pojo.po.Receipts;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ReceiptsMapper extends BasicMapper<Receipts> {
    List<Receipts> queryInfo(String tableName);

    Integer insertReceipts(Receipts receipts);

    Integer updateReceipts(Receipts record);

    Integer batchDeleteRecord(@Param("ids") List<Long> ids, @Param("tableName") String tableName);

    Integer batchInvalidRecord(@Param("ids") List<Long> ids, @Param("tableName") String tableName);

    //生成内部编码
    String generateReceiptsNo(String tableName, String preNo);

    //通过id查找内部编码
    String selectNoById(String tableName, Long id);

    // 查询，通过表名和内部编码来获取主子表数据
    Receipts selectByTableNameAndNo(String tableName, String no);

    // 组合搜索
    List<Receipts> searchRecord(Receipts receipts);

    //通过name查询
    List<Receipts> selectByName(@Param("name") String name, @Param("tableName") String tableName);

    // 查询，通过表名和内部编码来获取主子表数据
    List<MaterialConcrete> selectAutocompleteInput();

}
